<template>
  <Select
    style="width:100px; margin-left: 10px;"
    v-bind:value="value"
    @on-change="val => $emit('change', val)"
  >
    <Option
      value="0"
      key="0"
    >{{ `下一题` }}</Option>
    <Option
      v-for="item in sortList"
      :value="item.sort"
      :key="item.sort"
    >{{ `第${item.sort}题` }}</Option>
    <Option
      value="9999"
      key="9999"
    >{{ `结束` }}</Option>
  </Select>
</template>

<script>
export default {
  name: 'Goto',
  model: {
    prop: 'value',
    event: 'change'
  },
  computed: {
    sortList() {
      return this.list.filter(item => item.sort !== this.except)
    }
  },
  props: {
    list: Array,
    value: String,
    except: String
  }
}
</script>